#include <cstdio>
#include <algorithm>

using namespace std;

struct Node
{
    int l, c;
};

bool operator < ( const Node &a, const Node &b )
{
    return a.l < b.l;
}

int main( )
{
    int t, n, i, j, k;
    Node a[ 51 ];
    scanf("%d", &t);
    while ( t-- )
    {
        scanf("%d", &n);
        for ( i = 0; i < n; i++ )
            scanf("%d%d", &a[ i ].l, &a[ i ].c);
        sort( a, a + n );
        for ( i = 0; i < n; i++ )
        {
            for ( j = 0; j < a[ i ].c; j++ )
            {
                printf(">+");
                for ( k = 0; k < a[ i ].l - 2; k++ )
                    printf("-");
                printf("+>\n");
            }
            printf("\n");
        }
    }
    return 0;
}
